< previous page page_95 next page >

Page 95
Table 3.2 Static Colors
SYSTEM PALETTE
INDEX
VISUAL BASIC
CONSTANT
VALUECOLOR
0
e10a6a0a59f035e870d90cca05b85fce.gif
vbBlack
&H0Black
1
&H80Dark red
2
&H8000Dark green
3
&H8080Dark yellow
4
&H800000Dark blue
5
&H800080Dark magenta
6
&H808000Dark cyan
7
&HC0C0C0Light gray
8
&HC0DCC0Money green
9
&HF0CAA6Sky blue
246
&HF0FBFFCream
247
&HA4A0A0Medium gray
248
&H808080Dark gray
249
e10a6a0a59f035e870d90cca05b85fce.gif
vbRed
&HFFRed
250
e10a6a0a59f035e870d90cca05b85fce.gif
vbGreen
&HFF00Green
251
e10a6a0a59f035e870d90cca05b85fce.gif
vbYellow
&HFFFFYellow
252
e10a6a0a59f035e870d90cca05b85fce.gif
vbBlue
&HFF0000Blue
253
e10a6a0a59f035e870d90cca05b85fce.gif
vbMagenta
&HFF00FFMagenta
254
e10a6a0a59f035e870d90cca05b85fce.gif
vbCyan
&HFFFF00Cyan
255
e10a6a0a59f035e870d90cca05b85fce.gif
vbWhite
&HFFFFFFWhite

is 250, or &HFA in hexadecimal. If you invert the bits in the value &HFA, you get &H05. If you subtract 250 from 255, you get 5, the same value.
Because the inverted value for 250 is 5, if you draw in invert mode on a form with a green (system palette entry 250) background, you produce the color at position 5 in the system color palette, which is dark magenta.
The static colors are arranged so that inverting one of them produces a color that contrasts sharply with the original color. Green is a very bright color, and dark magenta is a very dark color. As you can see from the list, inverted values of bright colors are dark colors and vice versa. As a result, when you draw in invert mode, the results should be visible, no matter how cluttered the screen is.
On the other hand, the system cannot guarantee that the inverted value of a non-static color will contrast well with the original color. For instance, the system palette may happen to contain the color &HD0FFD0 (pale green) in entry 10 and the almost identi-

 
< previous page page_95 next page >